package com.hdb;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by aszer on 2016/11/12.
 */
@Entity
@Table(name = "notice", schema = "testin", catalog = "")
public class TNotice {
    private int noticeId;
    private int adminId;
    private String noticeTitle;
    private String noticeInfo;
    private Timestamp noticeDate;
    private int noticeTop;

    @Id
    @Column(name = "notice_id", nullable = false)
    public int getNoticeId() {
        return noticeId;
    }

    public void setNoticeId(int noticeId) {
        this.noticeId = noticeId;
    }

    @Basic
    @Column(name = "admin_id", nullable = false)
    public int getAdminId() {
        return adminId;
    }

    public void setAdminId(int adminId) {
        this.adminId = adminId;
    }

    @Basic
    @Column(name = "notice_title", nullable = false, length = 32)
    public String getNoticeTitle() {
        return noticeTitle;
    }

    public void setNoticeTitle(String noticeTitle) {
        this.noticeTitle = noticeTitle;
    }

    @Basic
    @Column(name = "notice_info", nullable = false, length = 2048)
    public String getNoticeInfo() {
        return noticeInfo;
    }

    public void setNoticeInfo(String noticeInfo) {
        this.noticeInfo = noticeInfo;
    }

    @Basic
    @Column(name = "notice_date", nullable = false)
    public Timestamp getNoticeDate() {
        return noticeDate;
    }

    public void setNoticeDate(Timestamp noticeDate) {
        this.noticeDate = noticeDate;
    }

    @Basic
    @Column(name = "notice_top", nullable = false)
    public int getNoticeTop() {
        return noticeTop;
    }

    public void setNoticeTop(int noticeTop) {
        this.noticeTop = noticeTop;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TNotice tNotice = (TNotice) o;

        if (noticeId != tNotice.noticeId) return false;
        if (adminId != tNotice.adminId) return false;
        if (noticeTop != tNotice.noticeTop) return false;
        if (noticeTitle != null ? !noticeTitle.equals(tNotice.noticeTitle) : tNotice.noticeTitle != null) return false;
        if (noticeInfo != null ? !noticeInfo.equals(tNotice.noticeInfo) : tNotice.noticeInfo != null) return false;
        if (noticeDate != null ? !noticeDate.equals(tNotice.noticeDate) : tNotice.noticeDate != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = noticeId;
        result = 31 * result + adminId;
        result = 31 * result + (noticeTitle != null ? noticeTitle.hashCode() : 0);
        result = 31 * result + (noticeInfo != null ? noticeInfo.hashCode() : 0);
        result = 31 * result + (noticeDate != null ? noticeDate.hashCode() : 0);
        result = 31 * result + noticeTop;
        return result;
    }
}
